package com.work.intelligent_transportation2;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.Toast;

import androidx.appcompat.app.AppCompatActivity;

public class RegisterActivity extends AppCompatActivity {

    private LinearLayout internetSetting;
    private EditText registerUserName;
    private EditText registerPassword;
    private EditText registerAgainPassword;
    private EditText registerPhoneNumber;
    private Button registerCancel;
    private Button registerContinue;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_register);
        initView();
        
        registerContinue.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String r_userName = registerUserName.getText().toString().trim();
                String r_userPassword = registerAgainPassword.getText().toString().trim();
                String r_userAgainPassword = registerAgainPassword.getText().toString().trim();
                String r_phoneNumber = registerPhoneNumber.getText().toString().trim();
                Toast.makeText(RegisterActivity.this,"注册成功，快去登录吧！",Toast.LENGTH_SHORT).show();
                Intent intent = new Intent(RegisterActivity.this, Sign_inActivity.class);
                startActivity(intent);
            }
        });
        registerCancel.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }

    private void initView() {
        internetSetting = (LinearLayout) findViewById(R.id.internet_setting);
        registerUserName = (EditText) findViewById(R.id.register_userName);
        registerPassword = (EditText) findViewById(R.id.register_password);
        registerAgainPassword = (EditText) findViewById(R.id.register_again_password);
        registerPhoneNumber = (EditText) findViewById(R.id.register_phoneNumber);
        registerCancel = (Button) findViewById(R.id.register_cancel);
        registerContinue = (Button) findViewById(R.id.register_continue);
    }
}